﻿@using Comswing.Website.Models.SwingViewModels;

@model SwingsViewModel

@{
    ViewBag.Title = "COMSWING! - Swings";
}

@section Scripts{
    @Content.ViewModel("SwingsViewModel.js", Url)
    @Content.ViewModel("SwingViewModel.js", Url)
    @Content.ViewModel("BitcoinViewModel.js", Url)
    @Html.Partial("_SwingTemplate", new SwingViewModel())

    <script>
        var swingData = ' @Html.Raw(Model.ToJson()) ';
        var swingJSON = JSON.parse(swingData);
        var viewModel = new SwingsViewModel(swingJSON);
        ko.applyBindings(viewModel);
    </script>
}

<div class="jumbotron color-white">
    <div class="row">
        @Html.Partial("_BitcoinMonitor", Model.BitcoinState)
    </div>
    <div class="row ">
        <h2>Swing list</h2>
        <div class="separator-smaller"></div>
    </div>
    <div data-bind="template: { name: 'swing-template', foreach: Swings }"></div>
</div>
